/*
 * @Description: resume pause测试按钮
 * @Author: yingying.fan
 * @Date: 2019-07-01 12:54:33
 * @Last Modified by: yingying.fan
 * @Last Modified time: 2019-07-01 12:54:33
 */
<template>
  <div style="position:absolute;left:0;bottom:3rem;">
    <button @click="fireResumeEvent">resume</button>
    <button @click="firePauseEvent">pause</button>
  </div>
</template>

<script>
export default {
  components: {

  },
  data() {
    return {

    }
  },
  mounted() {
    this.addTestEvent()
  },
  methods: {
    addTestEvent() {
      window.resumeEvent = document.createEvent('HTMLEvents')
      window.resumeEvent.initEvent('resume', false, false)
      window.pauseEvent = document.createEvent('HTMLEvents')
      window.pauseEvent.initEvent('pause', false, false)
    },
    fireResumeEvent() {
      document.dispatchEvent(window.resumeEvent)
    },
    firePauseEvent() {
      document.dispatchEvent(window.pauseEvent)
    }
  }
}
</script>

<style>
</style>
